include myio.inc

data segment 
	tempchar db ?
	tempstring db 10 dup(?)
	mess1 db 'The Char Input Test:','$'
	mess2 db 'The Char Output Test:','$'
	mess3 db 'The String Input Test:','$'
	mess4 db 'The String Output Test:','$'
	mess5 db 'The SF Test:','$'
	mess6 db 'The ZF Test:','$'
	mess7 db 'The PF Test:','$'
	mess8 db 'The CF Test:','$'
	mess9 db 'The Reg Output Test:','$'
data ends

code segment
main proc far
	assume cs:code,ds:data
start:
	push ds
	sub ax,ax
	push ax
	
	mov ax,data
	mov ds,ax

	lea dx,mess1
	call	print
	inchar tempchar		;char input test

	lea dx,mess2
	call	print
	outchar tempchar	;char output test

	lea dx,mess3
	call	print
	instring tempstring,10		;string input test

	lea dx,mess4
	call	print
	outstring tempstring		;string output test

	lea dx,mess5
	call	print
	mov ax,07fffh			;sf test
	mov bx,07fffh
	add ax,bx
	outflag 7
	
	lea dx,mess6
	call	print
	sub ax,ax
	outflag 6			;zf test
	
	lea dx,mess7
	call	print
	mov ax,1
	mov bx,2
	add ax,bx
	outflag 2			;pf test

	lea dx,mess8
	call	print
	mov ax,0ffffh
	mov bx,0ffffh
	add ax,bx
	outflag 0			;cf test

	lea dx,mess9
	call print
	mov al,35h
	outreg al

	ret
main endp

print proc near
	mov ah,09h
	int 21h

	mov ah,02h
	mov dl,0ah
	int 21h
	mov ah,02h
	mov dl,0dh
	int 21h	
	ret
print endp
code ends
	end start
